package homework;

import java.util.ArrayList;
import java.util.Random;

public class Test07_RedBall {
    public static void main(String[] args) {
        //大乐透 1-33 五个红球 1-16蓝球2个
        ArrayList<Integer> redBall = new ArrayList<>();
        while(redBall.size()<5){
            Random random = new Random();
            int number = random.nextInt(33)+1;
            //判断是否重复 不在数组中的时候加入
            if(!redBall.contains(number)){
                redBall.add(number);
            }
        }
        System.out.println(redBall);
        ArrayList<Integer> blueBall = new ArrayList<>();
        while(blueBall.size()<2){
            Random random = new Random();
            int number = random.nextInt(16)+1;
            //判断是否重复 不在数组中的时候加入
            if(!blueBall.contains(number)){
                blueBall.add(number);
            }
        }
        System.out.println(blueBall);
    }
}
